The Natural Language Processing Workshop by unknow

The Natural Language Processing Workshop by unknow

Author:unknow
Language: eng
Format: epub
Publisher: Packt Publishing Pvt. Ltd.
Published: 2020-08-14T00:00:00+00:00


Saving and Loading Models

After a model has been built and its performance matches our expectations, we may want to save it for future use. This eliminates the time needed for rebuilding it. Models can be saved on the hard disk using the joblib and pickle libraries.

The pickle module makes use of binary protocols to save and load Python objects. joblib makes use of the pickle library protocols, but it improves on them to provide an efficient replacement to save large Python objects. Both libraries have two main functions that we will make use of to save and load our models:

dump: This function is used to save a Python object to a file on the disk.

loads: This function is used to load a saved Python object from a file on the disk.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.